set(ZSERIO_GEN_DIR ${CMAKE_CURRENT_BINARY_DIR}/gen)
set(ZSERIO_GENERATED_SOURCES
    ${ZSERIO_GEN_DIR}/constants/BITFIELD8_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/BITFIELD8_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/BOOL_FALSE_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/BOOL_TRUE_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/Colors.cpp
    ${ZSERIO_GEN_DIR}/constants/Colors.h
    ${ZSERIO_GEN_DIR}/constants/ColorsSubtype.h
    ${ZSERIO_GEN_DIR}/constants/DEFAULT_PEN_COLOR.h
    ${ZSERIO_GEN_DIR}/constants/DEFAULT_PEN_COLOR_VALUE.h
    ${ZSERIO_GEN_DIR}/constants/FLOAT16_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/FLOAT32_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/FLOAT64_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/HEX_ESC_STRING_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/INT16_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/INT16_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/Int25Subtype.h
    ${ZSERIO_GEN_DIR}/constants/INT32_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/INT32_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/INT64_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/INT64_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/INT8_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/INT8_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/INTFIELD8_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/INTFIELD8_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/OCTAL_ESC_STRING_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/STRING_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/SUBTYPE_BLUE_COLOR_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/SUBTYPE_INT25_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/UINT16_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/UINT16_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/UINT32_FULL_MASK.h
    ${ZSERIO_GEN_DIR}/constants/UINT32_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/UINT32_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/UINT64_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/UINT64_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/UINT8_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/UINT8_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/UNICODE_ESC_STRING_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARIABLE_BITFIELD_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARIABLE_INTFIELD_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARINT16_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARINT16_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARINT32_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARINT32_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARINT64_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARINT64_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARINT_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARINT_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARUINT16_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARUINT16_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARUINT32_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARUINT32_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARUINT64_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARUINT64_MIN_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARUINT_MAX_CONSTANT.h
    ${ZSERIO_GEN_DIR}/constants/VARUINT_MIN_CONSTANT.h
)

zserio_add_library(TARGET constants_zs
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zs
    MAIN_SOURCE constants.zs
    OUT_DIR ${ZSERIO_GEN_DIR}
    OUT_FILES ${ZSERIO_GENERATED_SOURCES}
    ZSERIO_CORE_DIR ${ZSERIO_JAR_DIR}
    ZSERIO_OPTIONS -withoutSourcesAmalgamation -cppStandard ${ZSERIO_CPP_STANDARD}
)

add_test_sources(
    ${ZSERIO_CPP_DIR}/ConstantsTest.cpp
)

add_test_dependencies(constants_zs)
